#define _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"

void TestSList1()
{
	SLTNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLTPrint(plist);

	SLPushback(&plist, 5);
	SLPushback(&plist, 6);
	SLPushback(&plist, 7);
	SLPushback(&plist, 8);
	SLTPrint(plist);

	SLPopback(&plist);
	SLPopback(&plist);
	SLPopback(&plist);
	SLPopback(&plist);
	SLTPrint(plist);

	SLPopFront(&plist);
	SLPopFront(&plist);
	SLTPrint(plist);

	SLTNode*pos1 = STFind(plist, 1);
	if (pos1)
	{
		SLInsert(&plist, pos1, 8);
	}
	SLTPrint(plist);

	SLTNode* pos2 = STFind(plist, 2);
	if (pos2)
	{
		SLErase(&plist, pos2);
	}
	SLTPrint(plist);

	SLTNode* pos3 = STFind(plist, 1);
	if (pos3)
	{
		SLEraseAfter(pos3);
	}
	SLTPrint(plist);

	SListDestroy(plist);
}
int main()
{
	TestSList1();
	return 0;
}